import { SYS_LOCAL_DIC } from '@/util/SYS_LOCAL_DIC'
import { DicUrl,DeptUrl,RoleUrl } from '@/views/system/dic/dicApi'
import { validatePhoneStyle,validateEmailStyle } from "@/util/validateStyle";

import i18n from '@/lang' // Internationalization


export default {
    // maxHeight: 400,
    index: true,
    border: true,
    expand: false,
    excelBtn:true,
    title:i18n.t("system.SysUser.title"),//表格的标题
    // title:'系统用户表',//表格的标题
    menuWidth:130,
    stripe: false,
    selection: true,
    // customClass: '',自定义弹出框样式
    menuBtn: true,
    // menuWidth: 100,
    menuAlign: 'center',
    align: 'center',
    searchSize: 'small',
    menuType: 'menu',
    // defaultSort: {
    //   prop: 'name',
    //   order: 'descending'
    // },
    dicData: SYS_LOCAL_DIC,
    column: [{
            label: i18n.t("system.SysUser.account"),
            prop: "account",
            tip: '这是信息提示',
            width: 120,
            sortable: true,
            search: true,
            solt: true,
            showClomnu: false, //列不显示无法控制
            placeholder: '请输入登录账号',
            rules: [{ required: true, message: "请输入登录账号", trigger: "blur" }]
        },
        {
            label: i18n.t("system.SysUser.userName"),
            prop: "userName",
            sortable: true,
            search: true,
            addDisabled: false,
            formsolt: true,
            rules: [{
                required: true,
                message: "请输入" + i18n.t("system.SysUser.userName"),
                trigger: "blur"
            }]
        },
        {
            label: i18n.t("system.SysUser.password"),
            prop: "password",
            hide: true,
            rules: [ 
                { required: true, message: "请输入密码",trigger: "blur" },
                { min:5, max:12, message: "必须5-12位密码", trigger: 'blur' }
            ],
        },
        {
            label: i18n.t("system.SysUser.phone"),
            prop: "phone",
            type: "iphone",
            sortable: true,
            search: true,
            addDisabled: false,
            formsolt: true,
            rules: [ 
                { required: true, trigger: "blur", validator: validatePhoneStyle }
                // { min:11, max:11, message: "必须11位电话号码", trigger: 'blur' },
            ],
        },
        {
            label: i18n.t("system.SysUser.email"),
            prop: "email",
            sortable: true,
            search: true,
            addDisabled: false,
            formsolt: true,
            rules: [ 
                { required: true, trigger: "blur", validator: validateEmailStyle }
            ]
        },
        {
            label: i18n.t("system.SysUser.userType"),
            prop: "userType",
            type: "select",
            dicUrl:DicUrl,
            dicQuery:{type: 'USERTYPE'}
        },
        {
            label: i18n.t("system.SysUser.roleList"),
            prop: "roleList",
            type: "select",
            multiple: true,
            solt: true,
            props: {value: 'id', label: 'roleName'},
            dicUrl:RoleUrl,
        },
        {
            label: i18n.t("system.SysUser.deptId"),
            prop: "deptId",
            width: "100",
            row: true,
            search: true,
            type:'select',
            props: {value: 'id', label: 'deptName'},
            dicUrl:DeptUrl,
        },
        {
            label: i18n.t("system.SysUser.sex"),
            prop: "sex",
            type: 'select',
            search: true,
            valueDefault: 1,
            hide: true,
            addVisdiplay: false,
            editDisabled: true,
            dicUrl:DicUrl,
            dicQuery:{type: 'SEX', format: 'int'}
        },
        {
            label: i18n.t("system.SysUser.birthDay"),
            prop: "birthDay",
            type: "date",
            width: "100",
            format:'yyyy-MM-dd',
            hide: true,
        },
        {
            label: i18n.t("system.SysUser.enable"),
            prop: "enable",
            width: "50",
            type: "switch",
            valueDefault: 1,
            dicData: SYS_LOCAL_DIC.USER_STATE,
        },
        {
            label: i18n.t("system.SysUser.address"),
            prop: "address",
            type: 'textarea',
            align: "left",
            maxRow: 4,
            minRow: 4,
            span: 24,
            sortable: false,
            hide: true,
            disabled: false,
            addDisabled: false,
            overHidden: true
        },
    ]
};